package cn.edu.whu.irlab.web;

import cn.edu.whu.irlab.model.Answer;
import cn.edu.whu.irlab.service.AnswerService;
import cn.edu.whu.irlab.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by Roger on 2016/8/1.
 */
@Controller
@RequestMapping("/answer")
public class AnswerController {

    @Autowired
    private AnswerService answerService;

    @Autowired
    private QuestionService questionService;

    /**
     * 创建回答
     * @param answer
     * @return
     */
    @RequestMapping(value = "/create", method = RequestMethod.POST)
    public String createAnswer(Answer answer){
//        answerService.insertSelective(answer);
        return "";
    }

    /**
     * 回答点赞
     * @param answerId
     * @return
     */
    @RequestMapping(value = "/approve/{answerId}", method = RequestMethod.POST)
    public String approve(@PathVariable Integer answerId){
//        answerService.increaseApprovalNum(answerId);
        return "";
    }
}
